﻿using System;
using UnityEngine;
namespace HBFramework
{
    /// <summary>
    /// 鼠标点击，拖拽观察
    /// </summary>
    [DisallowMultipleComponent]
    public class MouseClickObserver : MonoBehaviour
    {
        public event Action OnMouseDownAct;
        public event Action OnMouseUpAct;
        public event Action OnMouseUpAsButtonAct;
        public event Action OnMouseDragAct;
        private void OnMouseDown()
        {
            OnMouseDownAct?.Invoke();
        }

        private void OnMouseUp()
        {
            OnMouseUpAct?.Invoke();
        }

        private void OnMouseUpAsButton()
        {
            OnMouseUpAsButtonAct?.Invoke();
        }

        private void OnMouseDrag()
        {
            OnMouseDragAct?.Invoke();
        }
    }
}